package com.zhuiYun.project.api.WxLogin.service;

import com.zhuiYun.project.api.login.entity.User;
import com.zhuiYun.project.common.response.CommonResult;

import java.io.IOException;

/**
 * @Description TODO 小程序微信授权登录
 * @ClassName UserLoginService
 * @Author HH
 * @Date 2023/4/3 18:22
 **/
public interface WxLoginService {

    /**
    * @Description 获取openid
    * @Author HH
    * @Date 2023/4/11 8:38
    * @Return java.lang.String
    
    */
    CommonResult getOpenid(String code) throws IOException;

    /**
    * @Description 根据openid获取手机号
    * @Author HH
    * @Date 2023/4/11 17:03
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param openid
    */
    CommonResult getPhoneByOpenid(String openid);
    
    /**
     * @Description 小程序微信授权用户登录
     * @Author HH
     * @Date 2023/4/10 18:47
     * @Return com.zhuiYun.project.common.response.CommonResult
     * @param user
     */
    CommonResult login(User user);

    /**
     * @Description 根据openid获取小程序用户信息
     * @Author HH
     * @Date 2023/4/10 18:47
     * @Return com.zhuiYun.project.common.response.CommonResult
     * @param openid
     */
    CommonResult getUserInfo(String openid);

    /**
    * @Description 腾讯云发送手机短信
    * @Author HH
    * @Date 2023/4/12 9:43
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param phone
    */
    CommonResult sendPhoneCode(String phone);

    /**
    * @Description 判断手机短信验证码是否正确
    * @Author HH
    * @Date 2023/4/12 13:56
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param phone
* @param code
    */
    CommonResult verificationCode(String phone, String code);
}
